#include "script/glue/LuaGlue.h"

#include <btBulletDynamicsCommon.h>
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"

#include "BtOgre/BtOgrePG.h"
#include "BtOgre/BtOgreGP.h"
#include "BtOgre/BtOgreExtras.h"

namespace LuaGlue
{
	int RigidBody::create(lua_State *L)
	{
//		lua_pushnil(L);
		luaL_error(L, "Dont.");
//		lua_pushstring(L, "Really...");	
		return 1;
	}

//	int RigidBody::gc(lua_State *L)
//	{
//		return 1;
//	}

	int RigidBody::tostring (lua_State *L)
	{
//		std::stringstream ss;
		switch(lua_gettop(L))
			{
			case 0:
				lua_pushstring(L, className);
				break;
			case 1:
//				ss << unwrap<btRigidBody>(L, 1);
//				lua_pushstring(L, ss.str().c_str());
				lua_pushstring(L, className);
				break;
			default:
				return 0;
				break;
			}
		return 1;
	}

	int RigidBody::applyForce (lua_State *L)
	{
		return 1;
	}

	int RigidBody::applyTorque (lua_State *L)
	{
		return 1;
	}
}

DECLARE(RigidBody)
META(RigidBody)
{"__tostring", LuaGlue::RigidBody::tostring},
//{"__index",    LuaGlue::RigidBody::get},
//{"__newindex", LuaGlue::RigidBody::set},
//{"__gc", LuaGlue::RigidBody::gc},
METHODS(RigidBody)
method(LuaGlue::RigidBody, tostring),
method(LuaGlue::RigidBody, applyForce),
method(LuaGlue::RigidBody, applyTorque),
END
